﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ThongKeHotelCountry.ascx.vb"
    Inherits="Control_Customer_ThongKeHotelCountry" %>
<script type='text/javascript'>
    function ajaxJquery() {
        $(function () {


            $("#<%=txtMaKS.ClientID %>").keyup(function () {
                $(this).val($(this).val().toUpperCase());
                $("#<%=ddlKhachSan.ClientID %>").val($(this).val());
            });

            $("#<%=ddlKhachSan.ClientID %>").change(function () {

                if ($(this).val() != "-1") {
                    $("#<%=txtMaKS.ClientID %>").val($(this).val());
                }
                else {
                    $("#<%=txtMaKS.ClientID %>").val("");
                }
            });



            $(".Date").datepicker({ dateFormat: 'dd/mm/yy' });
            var url = '<%= ConfigurationManager.AppSettings("MainDomain") %>';

            $(".SubjectTitle input, .SubjectTitle select").keypress(function (e) {
                if (e.keyCode == 13) {
                    $("#<%=btnFilter.ClientID()%>").click();
                    return false;
                }
            });

            //check cookie to show or hide search pannel
            if ($.cookie('CookieSiteSearch') == 1) {
                $('#pnlSearch').show();
                $('#imgShowHide').attr("src", url + "images/arrow_popup.gif");
            }
            else {
                $('#pnlSearch').hide();
                $('#imgShowHide').attr("src", url + "images/arrow_showless.gif");
            }


            $('#B1').click(function (event) {

                //set cookie
                if ($.cookie('CookieSiteSearch') == 1) {
                    $.cookie('CookieSiteSearch', 0)
                }
                else {
                    $.cookie('CookieSiteSearch', 1)
                }
                $('#pnlSearch').slideToggle(500);
                if ($('#imgShowHide').attr("src") == url + "images/arrow_popup.gif") {
                    $('#imgShowHide').attr("src", url + "images/arrow_showless.gif");
                }
                else {
                    $('#imgShowHide').attr("src", url + "images/arrow_popup.gif");
                }
            });





            //reset all textbox and dropdownlist
            $("#<%=bnReset.ClientID %>").click(function () {
                $(".SubjectTitle input").val("");
                $(".SubjectTitle select").val("");
                $("#<%=btnFilter.ClientID %>").val("Tìm kiếm");
                $("#<%=bnReset.ClientID %>").val("Đặt lại");
                return false;
            });

        });



    }

    function confirmMultiDelete(strID) {
        var grdShow = document.getElementById("<%=grdShow.ClientID %>");
        var count = 0;
        for (i = 1; i < grdShow.children.item(0).children.length; i++) {
            if (grdShow.children.item(0).children.item(i).children.item(0).children.item(0).checked) {
                count += 1;
            }
        }
        if (count > 0) {
            return ComfirmDialog('<%=drpMessage.Items(1).Text%>', 0, strID, 0, 0);
        } else {
            Alertbox('<%=drpMessage.Items(2).Text%>');
            return false;
        }
    }
    function ComfirmDialog(strText, value, ObjectIdClick, ID, Type) {
        if (value == 0) {
            Confirmbox(strText, value, ObjectIdClick, ID, Type);
            return false;
        } else {
            if (Type == 1) {
                document.getElementById('<%=hidID.ClientID %>').value = ID;
                eval($("#" + ObjectIdClick + "").attr("href"));
            }
            else {

                $("#" + ObjectIdClick + "").click();
            }
        }
    }

</script>
<asp:UpdatePanel ID="uplCustomerList" runat="server">
    <ContentTemplate>
        <div class="HeadTitle">
            <h3>
                THỐNG KÊ KHÁCH SẠN - QUỐC GIA</h3>
        </div>
        <div class="SubjectTitle" id="SInfor" runat="server">
            <legend class="SubjectTitle">
                <img alt="" src="" id="imgShowHide" />
                <a id="B1" href="#">Tìm kiếm </a>&nbsp;&nbsp;</legend>
        </div>
        <div id="pnlSearch" class="SubjectTitle">
             <div class="DivRow">
                <div class="DivLeft">
                    <asp:Label ID="Label3" CssClass="TextLabel" runat="server" Text="Mã CSLT:" />
                </div>
                <div class="DivRight">
                    <asp:TextBox ID="txtMaKS" CssClass="TextBox" runat="server" Text="" Width="80px"
                        MaxLength="10" />
                    <asp:DropDownList ID="ddlKhachSan" CssClass="DropDownList" runat="server" />
                </div>
            </div>
            <div class="DivRow">
                <div class="DivLeft">
                    <asp:Label ID="Label2" CssClass="TextLabel" runat="server" Text="Phường/Xã:" />
                </div>
                <div class="DivRight">
                    <asp:TextBox ID="txtPhuongXa" CssClass="TextBox" runat="server" Text="" />
                </div>
            </div>
            <div class="DivRow">
                <div class="DivLeft">
                    <asp:Label ID="Label233" CssClass="TextLabel" runat="server" Text="Quận/Huyện:" />
                </div>
                <div class="DivRight">
                    <asp:TextBox ID="txtQuanHuyen" CssClass="TextBox" runat="server" Text="" />
                </div>
            </div>
            <div class="DivRow">
                <div class="DivLeft">
                    <asp:Label ID="Label433" CssClass="TextLabel" runat="server" Text="Loại CSLT:" />
                </div>
                <div class="DivRight">
                    <asp:DropDownList ID="ddlLoaiCSLT" CssClass="DropDownList" runat="server" />
                </div>
            </div>
            <div class="DivRow">
                <div class="DivLeft">
                    <asp:Label ID="Label4" CssClass="TextLabel" runat="server" Text="Loại người dùng:" />
                </div>
                <div class="DivRight">
                    <asp:DropDownList ID="ddlLoaiNguoiDung" CssClass="DropDownList" runat="server" />
                </div>
            </div>
            <div class="DivRow">
                <div style="width: 620px; float: left">
                    <div style="float: left" class="DivLeft">
                        <asp:Label ID="lblTerminate_date_edit" runat="server" Text="Ngày check in: " CssClass="TextLabel" />
                    </div>
                    <div style="width: 18%; float: left; padding-left: 0px !important">
                        <asp:TextBox ID="txtTuFromDate" CssClass="TextBox Date" Width="106px" runat="server"
                            Text="" />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtTuFromDate"
                            Display="None" ErrorMessage="Ngày không đúng định dạng" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$"></asp:RegularExpressionValidator>
                    </div>
                    <div style="width: 5%; float: left">
                        <asp:Label ID="lblRate_edit4" runat="server" Text="đến" CssClass="TextLabel" />
                    </div>
                    <div style="width: 18%; float: left">
                        <asp:TextBox ID="txtDenFromDate" CssClass="TextBox Date" Width="106px" runat="server"
                            Text="" />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtDenFromDate"
                            Display="None" ErrorMessage="Ngày nhập không đúng định dạng" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$"></asp:RegularExpressionValidator>
                    </div>
                </div>
            </div>
             <div class="DivRow">
                <div class="DivLeft">
                    &nbsp;
                </div>
                <div class="DivRight">
                    <asp:Button ID="btnFilter" runat="server" Text='Tìm kiếm' CssClass='btn' />
                    <asp:Button ID="bnReset" runat="server" Text='Đặt lại' CssClass='btn' CausesValidation="false" />
                </div>
            </div>
        </div>
        <div style="clear: both">
        </div>
        <asp:GridView ID="grdShow" runat="server" AutoGenerateColumns="False" EmptyDataText="{Không có dữ liệu}"
            AllowPaging="false" Width='100%' BorderWidth="1px" CssClass="GridBorder">
            <Columns>
                <asp:TemplateField HeaderText="Stt">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblSTT" Text=''></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="4%" HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:BoundField DataField='HotelName' HeaderText='Khách sạn'>
                    <ItemStyle Width='20%' />
                </asp:BoundField>
                <asp:BoundField DataField='TongSo' HeaderText='Tổng số'>
                    <ItemStyle Width='8%' />
                </asp:BoundField>
                <asp:BoundField DataField='My' HeaderText='Mỹ'>
                    <ItemStyle Width='8%' />
                </asp:BoundField>
                <asp:BoundField DataField='Phap' HeaderText='Pháp'>
                    <ItemStyle Width='8%' />
                </asp:BoundField>
                <asp:BoundField DataField='TrungQuoc' HeaderText='Trung Quốc'>
                    <ItemStyle Width='8%' />
                </asp:BoundField>
                <asp:BoundField DataField='HanQuoc' HeaderText='Hàn Quốc'>
                    <ItemStyle Width='8%' />
                </asp:BoundField>
                <asp:BoundField DataField='NhatBan' HeaderText='Nhật Bản'>
                    <ItemStyle Width='8%' />
                </asp:BoundField>
                <asp:BoundField DataField='TrieuTien' HeaderText='Triều Tiên'>
                    <ItemStyle Width='8%' />
                </asp:BoundField>
                <asp:BoundField DataField='conlai' HeaderText='Quốc tịch khác'>
                    <ItemStyle Width='8%' />
                </asp:BoundField>
            </Columns>
            <HeaderStyle Height="26px" HorizontalAlign="Left" CssClass="GridHeader" />
            <RowStyle CssClass="GridRow" Height="23px" />
            <AlternatingRowStyle CssClass="GridAlterRow" />
            <PagerStyle CssClass="GridPaged" HorizontalAlign="Right" Height="23px" />
            <PagerSettings Mode="Numeric" PageButtonCount="2" />
            <EmptyDataRowStyle CssClass="GridTextEmpty" HorizontalAlign="Center" />
        </asp:GridView>
        <div style="display: none">
            <asp:Button ID="btnDelete" CssClass="btn" runat="server" Text="Xóa" Visible="false" />
            <asp:Label ID="lblPage_Size" runat="server" Text="Số bản ghi trên trang:"></asp:Label>
            <asp:DropDownList ID="drpPage_Size" runat="server" AutoPostBack="True" Width="70px"
                CssClass="input_form">
                <asp:ListItem Text="10" Value="10"></asp:ListItem>
                <asp:ListItem Text="20" Value="20"></asp:ListItem>
                <asp:ListItem Text="50" Value="50" Selected></asp:ListItem>
                <asp:ListItem Text="100" Value="100"></asp:ListItem>
            </asp:DropDownList>
            <asp:Label ID="lblTotal" runat="server"></asp:Label></div>
        <div style="width: 99%">
            <!--phan trang-->
            <div id="results_resultsNavigationDiv" class="paginationEMP">
                <ul>
                    <asp:LinkButton ID="lnkFirst" runat="server"></asp:LinkButton>
                    <asp:Repeater ID="rptPage" runat="server">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkTitle" CssClass="page_num" runat="server" OnClick="lnkTitle_Click"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:Repeater>
                    <asp:LinkButton ID="lnkLast" runat="server"></asp:LinkButton>
                </ul>
            </div>
            <asp:HiddenField ID="hidCount" Value="0" runat="server" />
            <asp:HiddenField ID="hidIndex_page" Value="0" runat="server" />
            <asp:HiddenField ID="hidCur_Page" Value="1" runat="server" />
        </div>
        <div style='display: none'>
            <asp:DropDownList ID="drpMessage" runat="server">
                <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản ghi này không?' Value='0'></asp:ListItem>
                <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản đã chọn?' Value='1'></asp:ListItem>
                <asp:ListItem Text='Bạn phải chọn ít nhất một bản ghi.' Value='2'></asp:ListItem>
            </asp:DropDownList>
            <asp:HiddenField ID="hidID" Value="0" runat="server" />
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
